package com.oazon.common.util;

import android.widget.TextView;

public class TextViewUtil {
	
	public static void scrollToBottom(TextView view, String text) {
		view.setText(text);
		int viewHeight = view.getHeight();
		int curHeight = view.getLineCount() * view.getLineHeight();
		
		if(curHeight>viewHeight){
			//scrollTo 是以view的0.0点的位置计算的
			view.scrollTo(0, curHeight - viewHeight);
		}
	}
}
